<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>班级管理</title>
</head>
<body>

<div th:include="main :: head"></div>

<h1 style="display: flex;justify-content: space-around">班级管理</h1>

<div style="display: flex;justify-content: space-around">

    <div style="display: flex;justify-content: space-around">

        <div>

            <table border="1">  <!-- 分页查询 -->
                <tr th:each="x:${clzs}">
                    <td th:text="${x.clzno}"></td>
                    <td th:text="${x.clzname}"></td>
                    <td ><a th:href="'/adm/clz/go2update?clzno='+ ${x.clzno}">更改班级名称</a></td>
                    <td ><a th:href="'/adm/clz/del?clzno='+ ${x.clzno}">删除该班级</a></td>
                </tr>
            </table>

            <a th:href="'/adm/clz/prevpage?curpage='+${curpage}">上一页</a>
            <a th:text="${curpage}"></a> / <a th:text="${page}"></a>
            <a th:href="'/adm/clz/nextpage?curpage='+${curpage}">下一页</a>

        </div>

    </div>

    <div style="display: flex;justify-content: space-around">


        <div>

            <button><a href="/adm/clz/show">显示所有班级</a></button>

            <button><a href="/adm/clz/go2add">添加一个新的班级</a></button>

            <hr>



            <div th:if="${action=='add'}">   <!-- 显示 ： 添加班级  -->
                <h2 th:text="${actmsg}"></h2>
            </div>

            <div th:if="${action=='update'}">   <!-- 显示 ： 修改班级  -->
                <h2 th:text="${actmsg}"></h2>
            </div>



            <div th:if="${action=='add'}">  <!-- 添加 -->

                <form th:action="'/adm/clz/'+${action}" method="post">

                    班级编号：<input type="text" name="clzno"><br>
                    班级名称：<input type="text" name="clzname"><br>
                    <input type="submit" th:value="${actmsg}">

                </form>

            </div>

            <div th:if="${action=='update'}">  <!-- 修改 -->

                <form th:action="'/adm/clz/'+${action}" method="post">

                    班级编号：<input type="text" name="clzno" th:value="${clz.clzno}"><br>
                    班级名称：<input type="text" name="clzname" th:value="${clz.clzname}"><br>
                    <input type="submit" th:value="${actmsg}">

                </form>
            </div>

        </div>

    </div>

</div>

</body>
</html>